package com.hanlp.test;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.text.Font;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontWeight;
import javafx.stage.Stage;

public class FontT extends Application {
    @Override
    public void start(Stage primaryStage){
        Pane pane=new StackPane();
        Circle circle=new Circle();
        circle.setRadius(50);
        circle.setStroke(Color.BLACK);
        /*circle.setFill(new Color(0.5,0.5,0.5,1));*/
        circle.setFill(Color.PINK);

        Label label=new Label("JavaFx");
        // label.setFont(Font.font(("Courier"), FontWeight.BLACK,20));
        label.setFont(Font.font(("Courier New"),FontWeight.BLACK, FontPosture.ITALIC,20));
        pane.getChildren().add(circle);
        //label.setShape(circle);   TODO 这个不可用？
        pane.getChildren().add(label);
        Scene scene=new Scene(pane,200,200);
        primaryStage.setTitle("FontDemo");
        primaryStage.setScene(scene);
        primaryStage.show();
        System.out.println(Font.getFamilies());
    }
    public static void main(String[] args){
        launch(args);
    }
}
